import java.util.Scanner;

class A{
    @Override
    protected Object clone() throws CloneNotSupportedException {
        return super.clone();
    }
}
public class Test {
    public static void main4(String[] args) {
        try{
            System.out.println(1/0);
            int[] a = null;
            System.out.println(a.length);
            System.out.println("2222");
        }catch (ArithmeticException | NullPointerException e){
            System.out.println("被除数不可以为0！");
        }/*catch (NullPointerException e){
            System.out.println("空指针异常！");
        }*/
        System.out.println("11111");
    }
    public static int func() throws CloneNotSupportedException {
        Scanner sc = new Scanner(System.in);
        int a = sc.nextInt();
        try{
            System.out.println(1/a);
            return a;
        }catch (ArithmeticException | NullPointerException e){
            System.out.println("被除数不可以为0！");
        }finally {
            sc.close();
            return 10;
        }
        /*int a = 0;
        if(a == 0){
            //throw new ArithmeticException("a == 0");
            throw new CloneNotSupportedException("a == 0");
        }*/
    }
    public static void main(String[] args) throws CloneNotSupportedException {
        int ret = func();
        System.out.println("ret=" + ret );
    }
    public static void main2(String[] args) {
        /*try {
            可能出现异常的代码
        }catch (异常1){

        }catch (异常2){

        }catch (异常3){

        }....*/
    }
    public static void main1(String[] args) throws CloneNotSupportedException {
        //System.out.println(1/0);
        //int[] a1 = new int[]{1,2};
        //System.out.println(a1[2]);
        int[] a2 = null;
        System.out.println(a2.length);
        A a = new A();
        //A b = (A)a.clone();
        System.out.println();
    }
}
